<?php
require_once('../upyun.class.php');
$upyun = new UpYun('temtupian', 'fengqiaoju', 'fqj3733465');

try {
    echo "=========直接上传文件\r\n";
    $fh = fopen('sample.jpeg', 'rb');
    $rsp = $upyun->writeFile('file:///E:/site/yunimage/Application/Plugins/Upyun/sample.jpeg', $fh, True);   // 上传图片，自动创建目录
    fclose($fh);
    var_dump($rsp);
    echo "=========DONE\n\r\n";
 
}
catch(Exception $e) {
    echo $e->getCode();
    echo $e->getMessage();
}
